"""
以下代码存在问题：
代码在命名空间上（变量定义）不够干净、整洁
全局变量有被修改的风险

"""

account_amount = 0


def atm(num, deposit=True):
    global account_amount
    if deposit:
        account_amount += num
        print(f"存款：+{num},账户余额：{account_amount}")
    else:
        account_amount -= num
        print(f"存款：-{num},账户余额：{account_amount}")


atm(300)
atm(300)
atm(100, False)
print(account_amount)
